package com.linciping.gradle.transform

import com.android.build.gradle.AppExtension
import com.android.build.gradle.AppPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project

class TransformPlugin : Plugin<Project> {
    override fun apply(project: Project) {
        try {
            val appExtension = project.extensions.getByType(AppExtension::class.java)
            //添加transform
            //如果这个transform，需要依赖某个库，可以使用依赖库字符作为第二个参数，如果有多个依此类推
            appExtension.registerTransform(SampleTransform())
        } catch (ex: Exception) {
            println("project no app module")
        }
    }
}